package com.bnuz.vtl.service;

import com.bnuz.vtl.model.Comment;
import com.bnuz.vtl.repo.CommentRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentService implements BaseService<Comment, String> {

    @Autowired
    private CommentRepo commentRepo;

    @Override
    public Comment save(Comment comment) {
        return commentRepo.save(comment);
    }

    @Override
    public void deleteById(String commentId) {
        commentRepo.deleteById(commentId);
    }

    @Override
    public List<Comment> findAll() {
        return commentRepo.findAll();
    }

    @Override
    public Comment findById(String commentId) {
        return commentRepo.findById(commentId).orElse(null);
    }
}
